package com.tfswue.springboot_demo02.controller;

import com.tfswue.springboot_demo02.config.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
// 标注当前类是一个Controller类，控制层，@ResponseBody返回json数据，@Controller组合
@Controller
@ResponseBody
public class HelloController {
    @Value("${email}")
    private String email;

    @Value("${my1.email}")
    private String my1Email;

    @Value("${city1[0]}")
    private String city1;

    @Value("${sxt[0].mobile}")
    private String mobile;
    @RequestMapping("/hello")
    public String hello() {
        return "配置好热部署之后的显示信息";
    }
    @RequestMapping("/getvalue")
    public String getValue() {
        return email + ";"+ my1Email + ";" + city1 + ";" + mobile;
    }

    @RequestMapping("/email")
    public String email() {
        return "Eamil" + email;
    }
}
